/**
 * The contents of this file are subject to the OpenMRS Public License
 * Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://license.openmrs.org
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
 */
package org.openmrs.module.datalogging.db;

import java.util.List;
import java.util.Map;
import java.util.Set;

import org.openmrs.BaseOpenmrsObject;
import org.openmrs.Encounter;
import org.openmrs.Obs;
import org.openmrs.Person;
import org.openmrs.module.datalogging.configuration.Event;
import org.openmrs.module.datalogging.configuration.Variable;
import org.openmrs.module.datalogging.enums.EventType;
import org.openmrs.module.datalogging.model.LogEvent;

public interface DataLoggingDAO {
	
	LogEvent saveLogEvent(LogEvent logEvent);
	
	LogEvent getLogEvent(Integer eventId);
	
	List<LogEvent> getLogEvents(Person person);
	
	List<LogEvent> getLogEvents();
	
	Event saveEvent(Event event);
	
	Event getEvent(Integer eventId);
	
	List<Event> getEventsByEvent(EventType triggeringEvent);
	
	List<Event> getAllEvents();
	
	List<Event> findEvents(String partialName);
	
	Event getEvent(String name);
	
	Variable saveComponent(Variable variable);
	
	Variable getComponent(Integer variableId);
	
	List<Variable> getAllComponents();
	
	List<Variable> findComponents(String partialName);
	
	Variable getComponent(String name);
	
	List<Encounter> findEncounters(Person person, Map<String, Set<BaseOpenmrsObject>> map);
	
	List<Obs> findObservations(Person person, Map<String, Set<BaseOpenmrsObject>> map);
	
	Integer countEvents(String search);
	
	List<LogEvent> findEvents(String search, int start, int length);
	
}
